using System;
using System.Collections.Generic;
using System.Text;

using DataLite;
using DataLite.Values;

namespace MakeData
{
    class Program
    {
        const string HELP_TEXT = "Type: MakeData {sqlite file} {namespace} {output directory}";

        static void Main(string[] args)
        {
            string sqliteFile;
            string nameSpace;
            string output;

            args = new string[] { 
                @"F:\Documents and Settings\pablofoniko\Escritorio\SdlDotNetExamples\OpenGL2D.sqlite",
                "ExtrusionTile.Store",
                @"F:\Documents and Settings\pablofoniko\Escritorio\SdlDotNetExamples\ExtrusionTile" };

            if (args.Length != 3)
            {
                Console.WriteLine(HELP_TEXT);
            }
            else
            {                
                sqliteFile = args[0];
                nameSpace = args[1];
                output = args[2];

                /*LiteSchema mySchema = new LiteSchema("");

                Console.WriteLine("\nUser tables:\n"); 
                foreach(SqliteMasterVO item in mySchema.UserTables)
                {
                    Console.WriteLine("\t{0}",item.Name);
                }

                Console.WriteLine("\nTable columns:\n");
                foreach (SqliteMasterVO item in mySchema.UserTables)
                {
                    Console.WriteLine("\t{0}", item.Name);
                    foreach (ColumnInfoVO col in item.ColumnInfo) 
                    {
                        Console.WriteLine("\t|");
                        Console.WriteLine("\t+--{0}", col.Name);
                    }
                    Console.WriteLine();
                }*/

                //try{
                    LiteSchema mySchema = new LiteSchema(sqliteFile);
                    TemplateBuilder oCodeBuilder = new TemplateBuilder();
                    oCodeBuilder.Build(mySchema, nameSpace, output);
                /*}
                catch
                {

                }
                finally
                {

                }*/
            }


            //LiteSchema mySchema = new LiteSchema(@"F:\Documents and Settings\pablofoniko\Escritorio\gamedb.sqlite");

            /*TemplateBuilder oCodeBuilder = new TemplateBuilder();
            oCodeBuilder.Build(mySchema, "GameEnginePlus", @"F:\Documents and Settings\pablofoniko\Escritorio\GameEnginePlus");*/

            //Console.ReadLine();            
        }
    }
}
